
/**
 * 加载时的遮盖层
 */
var maskOnLoad = function(msg){
	/*
	$("<div id=\"maskWindowDiv\" class=\"datagrid-mask\"></div>").css({ display: "block", width: "100%", height: $(window).height() }).appendTo("body");
	$("<div class=\"datagrid-mask-msg\"></div>").html(msg).appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(window).height() - 45) / 2 });
	*/
	
	if($("#maskWindowDiv").length <= 0){
		
		$("<div id=\"maskWindowDiv\" style=\"text-align: center;\"></div>").appendTo("body").css({top: 100});
		
		$("<div id=\"maskWindowDivMsg\" class=\"datagrid-mask-msg\" style=\"margin-left: 58px;\"></div>").html(msg).appendTo("#maskWindowDiv").css({ display: "block"});
		
		$("#maskWindowDiv").window({
			width: 300,
			height: 100,
			collapsible: false,
			minimizable: false,
			maximizable: false,
			noheader: true,
			border: false,
			closable: false,
			closed: false,
			zIndex: 99999,
			draggable: true,
			resizable: false,
			shadow: false,
			modal : true
			//top: 80
		})
	}else{
		$("#maskWindowDivMsg").html(msg);
	}
	$("#maskWindowDiv").window("open");
}

/**
 * 加载完毕，隐藏遮盖层
 */
var closeMask = function(){
	$("#maskWindowDiv").window("close");
}

/**
 * 自动补0
 */
var autoFillZero = function(number){
	var result = number;
	if(number < 10){
		result = "0" + number;
	}
	return result;
}

/**
 * 获得当前时间
 * @return {TypeName} 
 */
var getNowTime = function() {
	var nowDate = new Date();
	
	var Year = nowDate.getFullYear();//支持IE和火狐浏览器
	var Month = autoFillZero(nowDate.getMonth() + 1);
	var Day = autoFillZero(nowDate.getDate());
	
	var Hours = autoFillZero(nowDate.getHours()); //获取当前小时数(0-23)
	var min = autoFillZero(nowDate.getMinutes()); //获取当前分钟数(0-59)
	var sec = autoFillZero(nowDate.getSeconds()); //获取当前秒数(0-59)
	var mill = nowDate.getMilliseconds(); //获取当前毫秒数(0-999)

	var CurrentDate = "";

	CurrentDate += Year;
	CurrentDate += Month;
	CurrentDate += Day;
	
	CurrentDate += Hours;
	CurrentDate += min;
	CurrentDate += sec;
	CurrentDate += mill;
	
	return CurrentDate;
}
